﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Aspose.Cells;

namespace json解析
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            //textBox7.Text= "{ 'errno':0,'data':{'count':1,'datastreams':[{'datapoints':[{'at':'2019-04-15 09:49:20.863','value':28}],'id':33}]},'error':'succ'}";

        }
        string 热量单位,流量单位;

        private void button1_Click(object sender, EventArgs e)
        {
            //string json = "{ 'errno':0,'data':{'count':1,'datastreams':[{'datapoints':[{'at':'2019-04-15 09:49:20.863','value':28}],'id':33}]},'error':'succ'}";
            string json = "{'objser':'000A','num':'04','data':[{'SER':'1231','time':'04.23-19:15:32','MBusResp':'682001010618000000812E901F0008443322110888776655177766554435665544332C99887766912200952200067000415015230419200200FE16'},{'SER':'1232','time':'06.21-19:15:32','MBusResp':'682002010918000000812E901F0008403020100880706050177760504435660540332C90807060772200662200045000415015230419200200FE16'},{'SER':'1233','time':'07.21-19:15:32','MBusResp':'682001080419000000812E901F0008403302110888716155177166154135605504332C99881761732200362200000560415015230419200200FE16'},{'SER':'1234','time':'04.21-19:15:32','MBusResp':'682001990418000000812E901F0008440322110888770605177766050435665540332C99887006622200142200012000415015230419200200FE16'}]}";
            //string json = "{'errno':0,'data':{'count':1,'datastreams':[{'datapoints':[{'at':'2019-04-22 08:33:28.408','value':'8000080{\"objser\":\"000A\",\"num\":\"05\",\"data\':[{\'SER\':\'1234\',\'time\':\'04.21-19:15:32\',\'MBusResp\':\'6820776655443322118130901F010000000011503637021100020000121821280035808762012C19750069570020010020131120002318000080007416\'},{\'SER\':\'1234\',\'time\':\'04.21-19:15:32\',\'MBusResp\':\'6820776655443322118130901F010000000011503637021100020000121821280035808762012C1975006957002001002013112000231007416\'},{\'SER\':\'1234\',\'time\':\'04.21-19:15:32\',\'MBusResp\':\'6820776655443322118130901F010000000011503637021100020000121821280035808762012C19750069570020010020131120002318000080007416\'},{\'SER\':\'1234\',\'time\':\'04.21-19:15:32\',\'MBusResp\':\'6820776655443322118130901F010000000011503637021100020000121821280035808762012C19750069570020010020131120002318000080007416\'},{\'SER\':\'1234\',\'time\':\'04.21-19:15:32\',\'MBusResp\':\'6820776655443322118130901F010000000011503637021100020000121821280035808762012C19750069570020010020131120002318000080007416\'}]}'}],'id':'3300_0_5750'}]},'error':'succ'}";
            JsonReader reader = new JsonTextReader(new StringReader(json));
            JObject jo1 = (JObject)JsonConvert.DeserializeObject(json);

            JObject jsonObj = null;
             
            jsonObj = JObject.Parse(json);

            //textBox1.Text =jo1["errno"].ToString();//完成
            //textBox2.Text = (string)jsonObj["data"]["count"];//完成
            ////一层嵌套
            //JArray das = JArray.Parse(jsonObj["data"]["datastreams"].ToString());
            //JObject j = JObject.Parse(das[0].ToString());
            //string dpo = j["datapoints"].ToString();
            //JArray dap = (JArray)JsonConvert.DeserializeObject(dpo);
            //textBox3.Text = dap[0]["at"].ToString();//完成
            //textBox4.Text = dap[0]["value"].ToString();//完成
            //textBox5.Text = j["id"].ToString();//完成
            //textBox6.Text = jo1["error"].ToString();//完成

            textBox61.Text = jo1["objser"].ToString();//完成
            textBox62.Text = jo1["num"].ToString();//完成
            int num = int.Parse(jo1["num"].ToString());//将num的字符串转成int
              //textBox3.Text = num.ToString();
              //for (int i = 0; i < num; i++)
              //{
              //一层嵌套
            switch (num)
            {
                #region 五个数组
                case 5:
                    JArray dat = JArray.Parse(jsonObj["data"].ToString());
                    JObject da0 = JObject.Parse(dat[0].ToString());//dat[0]第一组数
                    textBox1.Text = da0["SER"].ToString();//完成
                    textBox2.Text = da0["time"].ToString();//完成
                                                           //textBox5.Text = da["MBusResp"].ToString();//完成
                    string mbus0 = da0["MBusResp"].ToString();//完成
                                                              //textBox5.Text = mbus;
                    string 地址 = mbus0.Substring(4, 14);
                    string 地址A  = 地址 .Substring(12, 2) + 地址 .Substring(10, 2) + 地址 .Substring(8, 2) + 地址 .Substring(6, 2) + 地址 .Substring(4, 2) + 地址 .Substring(2, 2) + 地址 .Substring(0, 2);
                    textBox3.Text = 地址A;
                    string 日热量 = mbus0.Substring(30, 8);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位 
                    string 日热量A = 日热量.Substring(6, 2) + 日热量.Substring(4, 2) + 日热量.Substring(2, 2) + 日热量.Substring(0, 2);
                    string 日热量单位 = mbus0.Substring(38, 2);
                    switch (日热量单位)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox4.Text = 日热量A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量 = mbus0.Substring(40, 8);
                    string 累计热量A = 累计热量.Substring(6, 2) + 累计热量.Substring(4, 2) + 累计热量.Substring(2, 2) + 累计热量.Substring(0, 2);
                    string 累计热量单位 = mbus0.Substring(38, 2);
                    switch (累计热量单位)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox5.Text = 累计热量A.Insert(6, ".") + 热量单位;
                    string 瞬时热量 = mbus0.Substring(50, 8);
                    string 瞬时热量A = 瞬时热量.Substring(6, 2) + 瞬时热量.Substring(4, 2) + 瞬时热量.Substring(2, 2) + 瞬时热量.Substring(0, 2);
                    string 瞬时热量单位 = mbus0.Substring(48, 2);
                    switch (瞬时热量单位)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox6.Text = 瞬时热量A.Insert(6, ".") + 热量单位;
                    string 瞬时流量 = mbus0.Substring(60, 8);
                    string 瞬时流量A = 瞬时流量.Substring(6, 2) + 瞬时流量.Substring(4, 2) + 瞬时流量.Substring(2, 2) + 瞬时流量.Substring(0, 2);
                    string 瞬时流量单位 = mbus0.Substring(58, 2);
                    switch (瞬时流量单位)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox7.Text = 瞬时流量A.Insert(4, ".") + 流量单位;
                    string 累计流量 = mbus0.Substring(70, 8);
                    string 累计流量A = 累计流量.Substring(6, 2) + 累计流量.Substring(4, 2) + 累计流量.Substring(2, 2) + 累计流量.Substring(0, 2);
                    string 累计流量单位 = mbus0.Substring(68, 2);
                    switch (累计流量单位)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox8.Text = 累计流量A.Insert(6, ".") + 流量单位;

                    string 供水温度 = mbus0.Substring(78, 4);
                    string 供水温度A = 供水温度.Substring(2, 2) + 供水温度.Substring(0, 2);
                    textBox9.Text = 供水温度A.Insert(2, ".") + "℃";
                    string 回水温度 = mbus0.Substring(84, 4);
                    string 回水温度A = 回水温度.Substring(2, 2) + 回水温度.Substring(0, 2);
                    textBox10.Text = 回水温度A.Insert(2, ".") + "℃";
                    string 累计时间 = mbus0.Substring(90, 6);
                    string 累计时间A = 累计时间.Substring(4, 2) + 累计时间.Substring(2, 2) + 累计时间.Substring(0, 2);
                    textBox11.Text = 累计时间A + "h";
                    string 实时 = mbus0.Substring(96, 14);
                    string 实时时间 = 实时.Substring(12, 2) + 实时.Substring(10, 2) + 实时.Substring(8, 2) + 实时.Substring(6, 2) + 实时.Substring(4, 2) + 实时.Substring(2, 2) + 实时.Substring(0, 2);
                    textBox12.Text = 实时时间;
                    //第二组数据
                    JObject da1 = JObject.Parse(dat[1].ToString());//dat[0]第一组数
                    textBox24.Text = da1["SER"].ToString();//完成
                    textBox23.Text = da1["time"].ToString();//完成
                    string mbus1 = da1["MBusResp"].ToString();//完成
                    string 地址1 = mbus1.Substring(4, 14);
                    string 地址1A = 地址1.Substring(12, 2) + 地址1.Substring(10, 2) + 地址1.Substring(8, 2) + 地址1.Substring(6, 2) + 地址1.Substring(4, 2) + 地址1.Substring(2, 2) + 地址1.Substring(0, 2);
                    textBox22.Text = 地址1A;
                    string 日热量1 = mbus1.Substring(30, 8);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位 
                    string 日热量1A = 日热量1.Substring(6, 2) + 日热量1.Substring(4, 2) + 日热量1.Substring(2, 2) + 日热量1.Substring(0, 2);
                    string 日热量单位1 = mbus1.Substring(38, 2);
                    switch (日热量单位1)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox21.Text = 日热量1A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量1 = mbus1.Substring(40, 8);
                    string 累计热量1A = 累计热量1.Substring(6, 2) + 累计热量1.Substring(4, 2) + 累计热量1.Substring(2, 2) + 累计热量1.Substring(0, 2);
                    string 累计热量单位1 = mbus1.Substring(38, 2);
                    switch (累计热量单位1)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox20.Text = 累计热量1A.Insert(6, ".") + 热量单位;
                    string 瞬时热量1 = mbus1.Substring(50, 8);
                    string 瞬时热量1A = 瞬时热量1.Substring(6, 2) + 瞬时热量1.Substring(4, 2) + 瞬时热量1.Substring(2, 2) + 瞬时热量1.Substring(0, 2);
                    string 瞬时热量单位1 = mbus1.Substring(48, 2);
                    switch (瞬时热量单位1)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox19.Text = 瞬时热量1A.Insert(6, ".") + 热量单位;
                    string 瞬时流量1 = mbus1.Substring(60, 8);
                    string 瞬时流量1A = 瞬时流量1.Substring(6, 2) + 瞬时流量1.Substring(4, 2) + 瞬时流量1.Substring(2, 2) + 瞬时流量1.Substring(0, 2);
                    string 瞬时流量单位1 = mbus1.Substring(58, 2);
                    switch (瞬时流量单位1)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox18.Text = 瞬时流量1A.Insert(4, ".") + 流量单位;
                    string 累计流量1 = mbus1.Substring(70, 8);
                    string 累计流量1A = 累计流量1.Substring(6, 2) + 累计流量1.Substring(4, 2) + 累计流量1.Substring(2, 2) + 累计流量1.Substring(0, 2);
                    string 累计流量单位1 = mbus1.Substring(68, 2);
                    switch (累计流量单位1)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox17.Text = 累计流量1A.Insert(6, ".") + 流量单位;

                    string 供水温度1 = mbus1.Substring(78, 4);
                    string 供水温度1A = 供水温度1.Substring(2, 2) + 供水温度1.Substring(0, 2);
                    textBox16.Text = 供水温度1A.Insert(2, ".") + "℃";
                    string 回水温度1 = mbus1.Substring(84, 4);
                    string 回水温度1A = 回水温度1.Substring(2, 2) + 回水温度1.Substring(0, 2);
                    textBox15.Text = 回水温度1A.Insert(2, ".") + "℃";
                    string 累计时间1 = mbus1.Substring(90, 6);
                    string 累计时间1A = 累计时间1.Substring(4, 2) + 累计时间1.Substring(2, 2) + 累计时间1.Substring(0, 2);
                    textBox14.Text = 累计时间1A + "h";
                    string 实时1 = mbus1.Substring(96, 14);
                    string 实时时间1 = 实时1.Substring(12, 2) + 实时1.Substring(10, 2) + 实时1.Substring(8, 2) + 实时1.Substring(6, 2) + 实时1.Substring(4, 2) + 实时1.Substring(2, 2) + 实时1.Substring(0, 2);
                    textBox13.Text = 实时时间1;
                    //第三组数据
                    JObject da2 = JObject.Parse(dat[2].ToString());//dat[0]第一组数
                    textBox36.Text = da2["SER"].ToString();//完成
                    textBox35.Text = da2["time"].ToString();//完成
                    string mbus2 = da2["MBusResp"].ToString();//完成
                    string 地址2 = mbus2.Substring(4, 14);
                    string 地址2A = 地址2.Substring(12, 2) + 地址2.Substring(10, 2) + 地址2.Substring(8, 2) + 地址2.Substring(6, 2) + 地址2.Substring(4, 2) + 地址2.Substring(2, 2) + 地址2.Substring(0, 2);
                    textBox34.Text = 地址2A;
                    string 日热量2 = mbus2.Substring(30, 8);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位 
                    string 日热量2A = 日热量2.Substring(6, 2) + 日热量2.Substring(4, 2) + 日热量2.Substring(2, 2) + 日热量2.Substring(0, 2);
                    string 日热量单位2 = mbus2.Substring(38, 2);
                    switch (日热量单位2)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox33.Text = 日热量2A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量2 = mbus2.Substring(40, 8);
                    string 累计热量2A = 累计热量2.Substring(6, 2) + 累计热量2.Substring(4, 2) + 累计热量2.Substring(2, 2) + 累计热量2.Substring(0, 2);
                    string 累计热量单位2 = mbus2.Substring(38, 2);
                    switch (累计热量单位2)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox32.Text = 累计热量2A.Insert(6, ".") + 热量单位;
                    string 瞬时热量2 = mbus2.Substring(50, 8);
                    string 瞬时热量2A = 瞬时热量2.Substring(6, 2) + 瞬时热量2.Substring(4, 2) + 瞬时热量2.Substring(2, 2) + 瞬时热量2.Substring(0, 2);
                    string 瞬时热量单位2 = mbus2.Substring(48, 2);
                    switch (瞬时热量单位2)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox31.Text = 瞬时热量2A.Insert(6, ".") + 热量单位;
                    string 瞬时流量2 = mbus2.Substring(60, 8);
                    string 瞬时流量2A = 瞬时流量2.Substring(6, 2) + 瞬时流量2.Substring(4, 2) + 瞬时流量2.Substring(2, 2) + 瞬时流量2.Substring(0, 2);
                    string 瞬时流量单位2 = mbus2.Substring(58, 2);
                    switch (瞬时流量单位2)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox30.Text = 瞬时流量2A.Insert(4, ".") + 流量单位;
                    string 累计流量2 = mbus2.Substring(70, 8);
                    string 累计流量2A = 累计流量2.Substring(6, 2) + 累计流量2.Substring(4, 2) + 累计流量2.Substring(2, 2) + 累计流量2.Substring(0, 2);
                    string 累计流量单位2 = mbus2.Substring(68, 2);
                    switch (累计流量单位2)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox29.Text = 累计流量2A.Insert(6, ".") + 流量单位;

                    string 供水温度2 = mbus2.Substring(78, 4);
                    string 供水温度2A = 供水温度2.Substring(2, 2) + 供水温度2.Substring(0, 2);
                    textBox28.Text = 供水温度2A.Insert(2, ".") + "℃";
                    string 回水温度2 = mbus2.Substring(84, 4);
                    string 回水温度2A = 回水温度2.Substring(2, 2) + 回水温度2.Substring(0, 2);
                    textBox27.Text = 回水温度2A.Insert(2, ".") + "℃";
                    string 累计时间2 = mbus2.Substring(90, 6);
                    string 累计时间2A = 累计时间2.Substring(4, 2) + 累计时间2.Substring(2, 2) + 累计时间2.Substring(0, 2);
                    textBox26.Text = 累计时间2A + "h";
                    string 实时2 = mbus2.Substring(96, 14);
                    string 实时时间2 = 实时2.Substring(12, 2) + 实时2.Substring(10, 2) + 实时2.Substring(8, 2) + 实时2.Substring(6, 2) + 实时2.Substring(4, 2) + 实时2.Substring(2, 2) + 实时2.Substring(0, 2);
                    textBox25.Text = 实时时间2;
                    //第四组数据
                    JObject da3 = JObject.Parse(dat[3].ToString());//dat[0]第一组数
                    textBox48.Text = da3["SER"].ToString();//完成
                    textBox47.Text = da3["time"].ToString();//完成
                    string mbus3 = da3["MBusResp"].ToString();//完成
                    string 地址3 = mbus3.Substring(4, 14);
                    string 地址3A = 地址3.Substring(12, 2) + 地址3.Substring(10, 2) + 地址3.Substring(8, 2) + 地址3.Substring(6, 2) + 地址3.Substring(4, 2) + 地址3.Substring(2, 2) + 地址3.Substring(0, 2);
                    textBox46.Text = 地址3A;
                    string 日热量3 = mbus3.Substring(30, 8);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位
                    string 日热量3A = 日热量3.Substring(6, 2) + 日热量3.Substring(4, 2) + 日热量3.Substring(2, 2) + 日热量3.Substring(0, 2);
                    string 日热量单位3 = mbus3.Substring(38, 2);
                    switch (日热量单位3)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox45.Text = 日热量3A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量3 = mbus3.Substring(40, 8);
                    string 累计热量3A = 累计热量3.Substring(6, 2) + 累计热量3.Substring(4, 2) + 累计热量3.Substring(2, 2) + 累计热量3.Substring(0, 2);
                    string 累计热量单位3 = mbus3.Substring(38, 2);
                    switch (累计热量单位3)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox44.Text = 累计热量3A.Insert(6, ".") + 热量单位;
                    string 瞬时热量3 = mbus3.Substring(50, 8);
                    string 瞬时热量3A = 瞬时热量3.Substring(6, 2) + 瞬时热量3.Substring(4, 2) + 瞬时热量3.Substring(2, 2) + 瞬时热量3.Substring(0, 2);
                    string 瞬时热量单位3 = mbus3.Substring(48, 2);
                    switch (瞬时热量单位3)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox43.Text = 瞬时热量3A.Insert(6, ".") + 热量单位;
                    string 瞬时流量3 = mbus3.Substring(60, 8);
                    string 瞬时流量3A = 瞬时流量3.Substring(6, 2) + 瞬时流量3.Substring(4, 2) + 瞬时流量3.Substring(2, 2) + 瞬时流量3.Substring(0, 2);
                    string 瞬时流量单位3 = mbus3.Substring(58, 2);
                    switch (瞬时流量单位3)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox42.Text = 瞬时流量3A.Insert(4, ".") + 流量单位;
                    string 累计流量3 = mbus3.Substring(70, 8);
                    string 累计流量3A = 累计流量3.Substring(6, 2) + 累计流量3.Substring(4, 2) + 累计流量3.Substring(2, 2) + 累计流量3.Substring(0, 2);
                    string 累计流量单位3 = mbus3.Substring(68, 2);
                    switch (累计流量单位3)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox41.Text = 累计流量3A.Insert(6, ".") + 流量单位;

                    string 供水温度3 = mbus3.Substring(78, 4);
                    string 供水温度3A = 供水温度3.Substring(2, 2) + 供水温度3.Substring(0, 2);
                    textBox40.Text = 供水温度3A.Insert(2, ".") + "℃";
                    string 回水温度3 = mbus3.Substring(84, 4);
                    string 回水温度3A = 回水温度3.Substring(2, 2) + 回水温度3.Substring(0, 2);
                    textBox39.Text = 回水温度3A.Insert(2, ".") + "℃";
                    string 累计时间3 = mbus3.Substring(90, 6);
                    string 累计时间3A = 累计时间3.Substring(4, 2) + 累计时间3.Substring(2, 2) + 累计时间3.Substring(0, 2);
                    textBox38.Text = 累计时间3A + "h";
                    string 实时3 = mbus3.Substring(96, 14);
                    string 实时时间3 = 实时3.Substring(12, 2) + 实时3.Substring(10, 2) + 实时3.Substring(8, 2) + 实时3.Substring(6, 2) + 实时3.Substring(4, 2) + 实时3.Substring(2, 2) + 实时3.Substring(0, 2);
                    textBox37.Text = 实时时间3;
                    //第五组数据
                    JObject da4 = JObject.Parse(dat[4].ToString());//dat[0]第一组数
                    textBox60.Text = da4["SER"].ToString();//完成
                    textBox59.Text = da4["time"].ToString();//完成
                    string mbus4 = da4["MBusResp"].ToString();//完成
                    string 地址4 = mbus4.Substring(4, 14);
                    string 地址4A = 地址4.Substring(12, 2) + 地址4.Substring(10, 2) + 地址4.Substring(8, 2) + 地址4.Substring(6, 2) + 地址4.Substring(4, 2) + 地址4.Substring(2, 2) + 地址4.Substring(0, 2);
                    textBox58.Text = 地址4;
                    string 日热量4 = mbus4.Substring(30, 8);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位
                    string 日热量4A = 日热量4.Substring(6, 2) + 日热量4.Substring(4, 2) + 日热量4.Substring(2, 2) + 日热量4.Substring(0, 2);
                    string 日热量单位4 = mbus4.Substring(38, 2);
                    switch (日热量单位4)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox57.Text = 日热量4A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量4 = mbus4.Substring(40, 8);
                    string 累计热量4A = 累计热量4.Substring(6, 2) + 累计热量4.Substring(4, 2) + 累计热量4.Substring(2, 2) + 累计热量4.Substring(0, 2);
                    string 累计热量单位4 = mbus4.Substring(38, 2);
                    switch (累计热量单位4)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox56.Text = 累计热量4A.Insert(6, ".") + 热量单位;
                    string 瞬时热量4 = mbus4.Substring(50, 8);
                    string 瞬时热量4A = 瞬时热量4.Substring(6, 2) + 瞬时热量4.Substring(4, 2) + 瞬时热量4.Substring(2, 2) + 瞬时热量4.Substring(0, 2);
                    string 瞬时热量单位4 = mbus4.Substring(48, 2);
                    switch (瞬时热量单位4)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox55.Text = 瞬时热量4A.Insert(6, ".") + 热量单位;
                    string 瞬时流量4 = mbus4.Substring(60, 8);
                    string 瞬时流量4A = 瞬时流量4.Substring(6, 2) + 瞬时流量4.Substring(4, 2) + 瞬时流量4.Substring(2, 2) + 瞬时流量4.Substring(0, 2);
                    string 瞬时流量单位4 = mbus4.Substring(58, 2);
                    switch (瞬时流量单位4)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox54.Text = 瞬时流量4A.Insert(4, ".") + 流量单位;
                    string 累计流量4 = mbus4.Substring(70, 8);
                    string 累计流量4A = 累计流量4.Substring(6, 2) + 累计流量4.Substring(4, 2) + 累计流量4.Substring(2, 2) + 累计流量4.Substring(0, 2);
                    string 累计流量单位4 = mbus4.Substring(68, 2);
                    switch (累计流量单位4)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox53.Text = 累计流量4A.Insert(6, ".") + 流量单位;

                    string 供水温度4 = mbus4.Substring(78, 4);
                    string 供水温度4A = 供水温度4.Substring(2, 2) + 供水温度4.Substring(0, 2);
                    textBox52.Text = 供水温度4A.Insert(2, ".") + "℃";
                    string 回水温度4 = mbus4.Substring(84, 4);
                    string 回水温度4A = 回水温度4.Substring(2, 2) + 回水温度4.Substring(0, 2);
                    textBox51.Text = 回水温度4A.Insert(2, ".") + "℃";
                    string 累计时间4 = mbus4.Substring(90, 6);
                    string 累计时间4A = 累计时间4.Substring(4, 2) + 累计时间4.Substring(2, 2) + 累计时间4.Substring(0, 2);
                    textBox50.Text = 累计时间4A + "h";
                    string 实时4 = mbus4.Substring(96, 14);
                    string 实时时间4 = 实时4.Substring(12, 2) + 实时4.Substring(10, 2) + 实时4.Substring(8, 2) + 实时4.Substring(6, 2) + 实时4.Substring(4, 2) + 实时4.Substring(2, 2) + 实时4.Substring(0, 2);
                    textBox49.Text = 实时时间4;
                    //}
                    break;
#endregion
                #region 四个数组
                case 4:
                    JArray dat01 = JArray.Parse(jsonObj["data"].ToString());
                    JObject da01 = JObject.Parse(dat01[0].ToString());//dat[0]第一组数
                    textBox1.Text = da01["SER"].ToString();//完成
                    textBox2.Text = da01["time"].ToString();//完成
                    //textBox5.Text = da["MBusResp"].ToString();//完成
                    string mbus01 = da01["MBusResp"].ToString();//完成
                    //textBox5.Text = mbus;
                    string 地址01 = mbus01.Substring(4, 14);
                    string 地址01A = 地址01.Substring(12, 2) + 地址01.Substring(10, 2) + 地址01.Substring(8, 2) + 地址01.Substring(6, 2) + 地址01.Substring(4, 2) + 地址01.Substring(2, 2) + 地址01.Substring(0, 2);
                    textBox3.Text = 地址01A;
                    string 日热量01 = mbus01.Substring(30, 8);
                    string 日热量01A = 日热量01.Substring(6, 2) + 日热量01.Substring(4, 2) + 日热量01.Substring(2, 2) + 日热量01.Substring(0, 2);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位         
                    string 日热量单位01 = mbus01.Substring(38, 2);
                    switch (日热量单位01)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox4.Text = 日热量01A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量01 = mbus01.Substring(40, 8);
                    string 累计热量01A = 累计热量01.Substring(6, 2) + 累计热量01.Substring(4, 2) + 累计热量01.Substring(2, 2) + 累计热量01.Substring(0, 2);
                    string 累计热量单位01 = mbus01.Substring(38, 2);
                    switch (累计热量单位01)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox5.Text = 累计热量01A.Insert(6, ".") + 热量单位;
                    string 瞬时热量01 = mbus01.Substring(50, 8);
                    string 瞬时热量01A = 瞬时热量01.Substring(6, 2) + 瞬时热量01.Substring(4, 2) + 瞬时热量01.Substring(2, 2) + 瞬时热量01.Substring(0, 2);
                    string 瞬时热量单位01 = mbus01.Substring(48, 2);
                    switch (瞬时热量单位01)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox6.Text = 瞬时热量01A.Insert(6, ".") + 热量单位;
                    string 瞬时流量01 = mbus01.Substring(60, 8);
                    string 瞬时流量01A = 瞬时流量01.Substring(6, 2) + 瞬时流量01.Substring(4, 2) + 瞬时流量01.Substring(2, 2) + 瞬时流量01.Substring(0, 2);
                    string 瞬时流量单位01 = mbus01.Substring(58, 2);
                    switch (瞬时流量单位01)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox7.Text = 瞬时流量01A.Insert(4, ".") + 流量单位;
                    string 累计流量01 = mbus01.Substring(70, 8);
                    string 累计流量01A = 累计流量01.Substring(6, 2) + 累计流量01.Substring(4, 2) + 累计流量01.Substring(2, 2) + 累计流量01.Substring(0, 2);
                    string 累计流量单位01 = mbus01.Substring(68, 2);
                    switch (累计流量单位01)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox8.Text = 累计流量01A.Insert(6, ".") + 流量单位;

                    string 供水温度01 = mbus01.Substring(78, 4);
                    string 供水温度01A = 供水温度01.Substring(2, 2) + 供水温度01.Substring(0, 2);
                    textBox9.Text = 供水温度01A.Insert(2, ".") + "℃";
                    string 回水温度01 = mbus01.Substring(84, 4);
                    string 回水温度01A = 回水温度01.Substring(2, 2) + 回水温度01.Substring(0, 2);
                    textBox10.Text = 回水温度01A.Insert(2, ".") + "℃";
                    string 累计时间01 = mbus01.Substring(90, 6);
                    string 累计时间01A = 累计时间01.Substring(4, 2) + 累计时间01.Substring(2, 2) + 累计时间01.Substring(0, 2);
                    textBox11.Text = 累计时间01A + "h";
                    string 实时01 = mbus01.Substring(96, 14);

                    string 实时时间01 = 实时01.Substring(12, 2) + 实时01.Substring(10, 2) + 实时01.Substring(8, 2) + 实时01.Substring(6, 2) + 实时01.Substring(4, 2) + 实时01.Substring(2, 2) + 实时01.Substring(0, 2);
                    textBox12.Text = 实时时间01;
                    //第二组数据
                    JObject da11 = JObject.Parse(dat01[1].ToString());//dat[0]第一组数
                    textBox24.Text = da11["SER"].ToString();//完成
                    textBox23.Text = da11["time"].ToString();//完成
                    string mbus11 = da11["MBusResp"].ToString();//完成
                    string 地址11 = mbus11.Substring(4, 14);
                    string 地址11A = 地址11.Substring(12, 2) + 地址11.Substring(10, 2) + 地址11.Substring(8, 2) + 地址11.Substring(6, 2) + 地址11.Substring(4, 2) + 地址11.Substring(2, 2) + 地址11.Substring(0, 2);
                    textBox22.Text = 地址11A;
                    string 日热量11 = mbus11.Substring(30, 8);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位 
                    string 日热量11A = 日热量11.Substring(6, 2) + 日热量11.Substring(4, 2) + 日热量11.Substring(2, 2) + 日热量11.Substring(0, 2);
                    string 日热量单位11 = mbus11.Substring(38, 2);
                    switch (日热量单位11)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox21.Text = 日热量11A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量11 = mbus11.Substring(40, 8);
                    string 累计热量11A = 累计热量11.Substring(6, 2) + 累计热量11.Substring(4, 2) + 累计热量11.Substring(2, 2) + 累计热量11.Substring(0, 2);
                    string 累计热量单位11 = mbus11.Substring(38, 2);
                    switch (累计热量单位11)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox20.Text = 累计热量11A.Insert(6, ".") + 热量单位;
                    string 瞬时热量11 = mbus11.Substring(50, 8);
                    string 瞬时热量11A = 瞬时热量11.Substring(6, 2) + 瞬时热量11.Substring(4, 2) + 瞬时热量11.Substring(2, 2) + 瞬时热量11.Substring(0, 2);
                    string 瞬时热量单位11 = mbus11.Substring(48, 2);
                    switch (瞬时热量单位11)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "11A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox19.Text = 瞬时热量11A.Insert(6, ".") + 热量单位;
                    string 瞬时流量11 = mbus11.Substring(60, 8);
                    string 瞬时流量11A = 瞬时流量11.Substring(6, 2) + 瞬时流量11.Substring(4, 2) + 瞬时流量11.Substring(2, 2) + 瞬时流量11.Substring(0, 2);
                    string 瞬时流量单位11 = mbus11.Substring(58, 2);
                    switch (瞬时流量单位11)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox18.Text = 瞬时流量11A.Insert(4, ".") + 流量单位;
                    string 累计流量11 = mbus11.Substring(70, 8);
                    string 累计流量11A = 累计流量11.Substring(6, 2) + 累计流量11.Substring(4, 2) + 累计流量11.Substring(2, 2) + 累计流量11.Substring(0, 2);
                    string 累计流量单位11 = mbus11.Substring(68, 2);
                    switch (累计流量单位11)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox17.Text = 累计流量11A.Insert(6, ".") + 流量单位;

                    string 供水温度11 = mbus11.Substring(78, 4);
                    string 供水温度11A = 供水温度11.Substring(2, 2) + 供水温度11.Substring(0, 2);
                    textBox16.Text = 供水温度11A.Insert(2, ".") + "℃";
                    string 回水温度11 = mbus11.Substring(84, 4);
                    string 回水温度11A = 回水温度11.Substring(2, 2) + 回水温度11.Substring(0, 2);
                    textBox15.Text = 回水温度11A.Insert(2, ".") + "℃";
                    string 累计时间11 = mbus11.Substring(90, 6);
                    string 累计时间11A = 累计时间11.Substring(4, 2) + 累计时间11.Substring(2, 2) + 累计时间11.Substring(0, 2);
                    textBox14.Text = 累计时间11A + "h";
                    string 实时11 = mbus11.Substring(96, 14);
                    string 实时时间11 = 实时11.Substring(12, 2) + 实时11.Substring(10, 2) + 实时11.Substring(8, 2) + 实时11.Substring(6, 2) + 实时11.Substring(4, 2) + 实时11.Substring(2, 2) + 实时11.Substring(0, 2);
                    textBox13.Text = 实时时间11;
                    //第三组数据
                    JObject da21 = JObject.Parse(dat01[2].ToString());//dat[0]第一组数
                    textBox36.Text = da21["SER"].ToString();//完成
                    textBox35.Text = da21["time"].ToString();//完成
                    string mbus21 = da21["MBusResp"].ToString();//完成
                    string 地址21 = mbus21.Substring(4, 14);
                    string 地址21A = 地址21.Substring(12, 2) + 地址21.Substring(10, 2) + 地址21.Substring(8, 2) + 地址21.Substring(6, 2) + 地址21.Substring(4, 2) + 地址21.Substring(2, 2) + 地址21.Substring(0, 2);
                    textBox34.Text = 地址21A;
                    string 日热量21 = mbus21.Substring(30, 8);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位
                    string 日热量21A = 日热量21.Substring(6, 2) + 日热量21.Substring(4, 2) + 日热量21.Substring(2, 2) + 日热量21.Substring(0, 2);
                    string 日热量单位21 = mbus21.Substring(38, 2);
                    switch (日热量单位21)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox33.Text = 日热量21A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量21 = mbus21.Substring(40, 8);
                    string 累计热量21A = 累计热量21.Substring(6, 2) + 累计热量21.Substring(4, 2) + 累计热量21.Substring(2, 2) + 累计热量21.Substring(0, 2);
                    string 累计热量单位21 = mbus21.Substring(38, 2);
                    switch (累计热量单位21)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox32.Text = 累计热量21A.Insert(6, ".") + 热量单位;
                    string 瞬时热量21 = mbus21.Substring(50, 8);
                    string 瞬时热量21A = 瞬时热量21.Substring(6, 2) + 瞬时热量21.Substring(4, 2) + 瞬时热量21.Substring(2, 2) + 瞬时热量21.Substring(0, 2);
                    string 瞬时热量单位21 = mbus21.Substring(48, 2);
                    switch (瞬时热量单位21)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox31.Text = 瞬时热量21A.Insert(6, ".") + 热量单位;
                    string 瞬时流量21 = mbus21.Substring(60, 8);
                    string 瞬时流量21A = 瞬时流量21.Substring(6, 2) + 瞬时流量21.Substring(4, 2) + 瞬时流量21.Substring(2, 2) + 瞬时流量21.Substring(0, 2);
                    string 瞬时流量单位21 = mbus21.Substring(58, 2);
                    switch (瞬时流量单位21)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox30.Text = 瞬时流量21A.Insert(4, ".") + 流量单位;
                    string 累计流量21 = mbus21.Substring(70, 8);
                    string 累计流量21A = 累计流量21.Substring(6, 2) + 累计流量21.Substring(4, 2) + 累计流量21.Substring(2, 2) + 累计流量21.Substring(0, 2);
                    string 累计流量单位21 = mbus21.Substring(68, 2);
                    switch (累计流量单位21)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox29.Text = 累计流量21A.Insert(6, ".") + 流量单位;

                    string 供水温度21 = mbus21.Substring(78, 4);
                    string 供水温度21A = 供水温度21.Substring(2, 2) + 供水温度21.Substring(0, 2);
                    textBox28.Text = 供水温度21A.Insert(2, ".") + "℃";
                    string 回水温度21 = mbus21.Substring(84, 4);
                    string 回水温度21A = 回水温度21.Substring(2, 2) + 回水温度21.Substring(0, 2);
                    textBox27.Text = 回水温度21A.Insert(2, ".") + "℃";
                    string 累计时间21 = mbus21.Substring(90, 6);
                    string 累计时间21A = 累计时间21.Substring(4, 2) + 累计时间21.Substring(2, 2) + 累计时间21.Substring(0, 2);
                    textBox26.Text = 累计时间21A + "h";
                    string 实时21 = mbus21.Substring(96, 14);
                    string 实时时间21 = 实时21.Substring(12, 2) + 实时21.Substring(10, 2) + 实时21.Substring(8, 2) + 实时21.Substring(6, 2) + 实时21.Substring(4, 2) + 实时21.Substring(2, 2) + 实时21.Substring(0, 2);
                    textBox25.Text = 实时时间21;
                    //第四组数据
                    JObject da31 = JObject.Parse(dat01[3].ToString());//dat[0]第一组数
                    textBox48.Text = da31["SER"].ToString();//完成
                    textBox47.Text = da31["time"].ToString();//完成
                    string mbus31 = da31["MBusResp"].ToString();//完成
                    string 地址31 = mbus31.Substring(4, 14);
                    string 地址31A = 地址31.Substring(12, 2) + 地址31.Substring(10, 2) + 地址31.Substring(8, 2) + 地址31.Substring(6, 2) + 地址31.Substring(4, 2) + 地址31.Substring(2, 2) + 地址31.Substring(0, 2);
                    textBox46.Text = 地址31A;
                    string 日热量31 = mbus31.Substring(30, 8);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位
                    string 日热量31A = 日热量31.Substring(6, 2) + 日热量31.Substring(4, 2) + 日热量31.Substring(2, 2) + 日热量31.Substring(0, 2);
                    string 日热量单位31 = mbus31.Substring(38, 2);
                    switch (日热量单位31)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox45.Text = 日热量31A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量31 = mbus31.Substring(40, 8);
                    string 累计热量31A = 累计热量31.Substring(6, 2) + 累计热量31.Substring(4, 2) + 累计热量31.Substring(2, 2) + 累计热量31.Substring(0, 2);
                    string 累计热量单位31 = mbus31.Substring(38, 2);
                    switch (累计热量单位31)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox44.Text = 累计热量31A.Insert(6, ".") + 热量单位;
                    string 瞬时热量31 = mbus31.Substring(50, 8);
                    string 瞬时热量31A = 瞬时热量31.Substring(6, 2) + 瞬时热量31.Substring(4, 2) + 瞬时热量31.Substring(2, 2) + 瞬时热量31.Substring(0, 2);
                    string 瞬时热量单位31 = mbus31.Substring(48, 2);
                    switch (瞬时热量单位31)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox43.Text = 瞬时热量31A.Insert(6, ".") + 热量单位;
                    string 瞬时流量31 = mbus31.Substring(60, 8);
                    string 瞬时流量31A = 瞬时流量31.Substring(6, 2) + 瞬时流量31.Substring(4, 2) + 瞬时流量31.Substring(2, 2) + 瞬时流量31.Substring(0, 2);
                    string 瞬时流量单位31 = mbus31.Substring(58, 2);
                    switch (瞬时流量单位31)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox42.Text = 瞬时流量31A.Insert(4, ".") + 流量单位;
                    string 累计流量31 = mbus31.Substring(70, 8);
                    string 累计流量31A = 累计流量31.Substring(6, 2) + 累计流量31.Substring(4, 2) + 累计流量31.Substring(2, 2) + 累计流量31.Substring(0, 2);
                    string 累计流量单位31 = mbus31.Substring(68, 2);
                    switch (累计流量单位31)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox41.Text = 累计流量31A.Insert(6, ".") + 流量单位;

                    string 供水温度31 = mbus31.Substring(78, 4);
                    string 供水温度31A = 供水温度31.Substring(2, 2) + 供水温度31.Substring(0, 2);
                    textBox40.Text = 供水温度21A.Insert(2, ".") + "℃";
                    string 回水温度31 = mbus31.Substring(84, 4);
                    string 回水温度31A = 回水温度31.Substring(2, 2) + 回水温度31.Substring(0, 2); textBox39.Text = 回水温度21A.Insert(2, ".") + "℃";
                    string 累计时间31 = mbus31.Substring(90, 6);
                    string 累计时间31A = 累计时间31.Substring(4, 2) + 累计时间31.Substring(2, 2) + 累计时间31.Substring(0, 2);
                    textBox38.Text = 累计时间31A + "h";
                    string 实时31 = mbus31.Substring(96, 14);
                    string 实时时间31 = 实时31.Substring(12, 2) + 实时31.Substring(10, 2) + 实时31.Substring(8, 2) + 实时31.Substring(6, 2) + 实时31.Substring(4, 2) + 实时31.Substring(2, 2) + 实时31.Substring(0, 2);
                    textBox37.Text = 实时时间31;
                    break;
#endregion
                #region 三个数组
                case 3:
                    JArray dat02 = JArray.Parse(jsonObj["data"].ToString());
                    JObject da02 = JObject.Parse(dat02[0].ToString());//dat[0]第一组数
                    textBox1.Text = da02["SER"].ToString();//完成
                    textBox2.Text = da02["time"].ToString();//完成
                    //textBox5.Text = da["MBusResp"].ToString();//完成
                    string mbus02 = da02["MBusResp"].ToString();//完成
                    //textBox5.Text = mbus;
                    string 地址02 = mbus02.Substring(4, 14);
                    string 地址02A = 地址02.Substring(12, 2) + 地址02.Substring(10, 2) + 地址02.Substring(8, 2) + 地址02.Substring(6, 2) + 地址02.Substring(4, 2) + 地址02.Substring(2, 2) + 地址02.Substring(0, 2);
                    textBox3.Text = 地址02A;
                    string 日热量02 = mbus02.Substring(30, 8);
                    string 日热量02A = 日热量02.Substring(6, 2) + 日热量02.Substring(4, 2) + 日热量02.Substring(2, 2) + 日热量02.Substring(0, 2);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位         
                    string 日热量单位02 = mbus02.Substring(38, 2);
                    switch (日热量单位02)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox4.Text = 日热量02A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量02 = mbus02.Substring(40, 8);
                    string 累计热量02A = 累计热量02.Substring(6, 2) + 累计热量02.Substring(4, 2) + 累计热量02.Substring(2, 2) + 累计热量02.Substring(0, 2);
                    string 累计热量单位02 = mbus02.Substring(38, 2);
                    switch (累计热量单位02)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox5.Text = 累计热量02A.Insert(6, ".") + 热量单位;
                    string 瞬时热量02 = mbus02.Substring(50, 8);
                    string 瞬时热量02A = 瞬时热量02.Substring(6, 2) + 瞬时热量02.Substring(4, 2) + 瞬时热量02.Substring(2, 2) + 瞬时热量02.Substring(0, 2);
                    string 瞬时热量单位02 = mbus02.Substring(48, 2);
                    switch (瞬时热量单位02)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox6.Text = 瞬时热量02A.Insert(6, ".") + 热量单位;
                    string 瞬时流量02 = mbus02.Substring(60, 8);
                    string 瞬时流量02A = 瞬时流量02.Substring(6, 2) + 瞬时流量02.Substring(4, 2) + 瞬时流量02.Substring(2, 2) + 瞬时流量02.Substring(0, 2);
                    string 瞬时流量单位02 = mbus02.Substring(58, 2);
                    switch (瞬时流量单位02)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox7.Text = 瞬时流量02A.Insert(4, ".") + 流量单位;
                    string 累计流量02 = mbus02.Substring(70, 8);
                    string 累计流量02A = 累计流量02.Substring(6, 2) + 累计流量02.Substring(4, 2) + 累计流量02.Substring(2, 2) + 累计流量02.Substring(0, 2);
                    string 累计流量单位02 = mbus02.Substring(68, 2);
                    switch (累计流量单位02)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox8.Text = 累计流量02A.Insert(6, ".") + 流量单位;

                    string 供水温度02 = mbus02.Substring(78, 4);
                    string 供水温度02A = 供水温度02.Substring(2, 2) + 供水温度02.Substring(0, 2);
                    textBox9.Text = 供水温度02A.Insert(2, ".") + "℃";
                    string 回水温度02 = mbus02.Substring(84, 4);
                    string 回水温度02A = 回水温度02.Substring(2, 2) + 回水温度02.Substring(0, 2);
                    textBox10.Text = 回水温度02A.Insert(2, ".") + "℃";
                    string 累计时间02 = mbus02.Substring(90, 6);
                    string 累计时间02A = 累计时间02.Substring(4, 2) + 累计时间02.Substring(2, 2) + 累计时间02.Substring(0, 2);
                    textBox11.Text = 累计时间02A + "h";
                    string 实时02 = mbus02.Substring(96, 14);

                    string 实时时间02 = 实时02.Substring(12, 2) + 实时02.Substring(10, 2) + 实时02.Substring(8, 2) + 实时02.Substring(6, 2) + 实时02.Substring(4, 2) + 实时02.Substring(2, 2) + 实时02.Substring(0, 2);
                    textBox12.Text = 实时时间02;
                    //第二组数据
                    JObject da12 = JObject.Parse(dat02[1].ToString());//dat[0]第一组数
                    textBox24.Text = da12["SER"].ToString();//完成
                    textBox23.Text = da12["time"].ToString();//完成
                    string mbus12 = da12["MBusResp"].ToString();//完成
                    string 地址12 = mbus12.Substring(4, 14);
                    string 地址12A = 地址12.Substring(12, 2) + 地址12.Substring(10, 2) + 地址12.Substring(8, 2) + 地址12.Substring(6, 2) + 地址12.Substring(4, 2) + 地址12.Substring(2, 2) + 地址12.Substring(0, 2);
                    textBox22.Text = 地址12A;
                    string 日热量12 = mbus12.Substring(30, 8);
                    string 日热量12A = 日热量12.Substring(6, 2) + 日热量12.Substring(4, 2) + 日热量12.Substring(2, 2) + 日热量12.Substring(0, 2);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位         
                    string 日热量单位12 = mbus12.Substring(38, 2);
                    switch (日热量单位12)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox21.Text = 日热量12A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量12 = mbus12.Substring(40, 8);
                    string 累计热量12A = 累计热量12.Substring(6, 2) + 累计热量12.Substring(4, 2) + 累计热量12.Substring(2, 2) + 累计热量12.Substring(0, 2);
                    string 累计热量单位12 = mbus12.Substring(38, 2);
                    switch (累计热量单位12)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox20.Text = 累计热量12A.Insert(6, ".") + 热量单位;
                    string 瞬时热量12 = mbus12.Substring(50, 8);
                    string 瞬时热量12A = 瞬时热量12.Substring(6, 2) + 瞬时热量12.Substring(4, 2) + 瞬时热量12.Substring(2, 2) + 瞬时热量12.Substring(0, 2);
                    string 瞬时热量单位12 = mbus12.Substring(48, 2);
                    switch (瞬时热量单位12)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox19.Text = 瞬时热量12A.Insert(6, ".") + 热量单位;
                    string 瞬时流量12 = mbus12.Substring(60, 8);
                    string 瞬时流量12A = 瞬时流量12.Substring(6, 2) + 瞬时流量12.Substring(4, 2) + 瞬时流量12.Substring(2, 2) + 瞬时流量12.Substring(0, 2);
                    string 瞬时流量单位12 = mbus12.Substring(58, 2);
                    switch (瞬时流量单位12)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox18.Text = 瞬时流量12A.Insert(4, ".") + 流量单位;
                    string 累计流量12 = mbus12.Substring(70, 8);
                    string 累计流量12A = 累计流量12.Substring(6, 2) + 累计流量12.Substring(4, 2) + 累计流量12.Substring(2, 2) + 累计流量12.Substring(0, 2);
                    string 累计流量单位12 = mbus12.Substring(68, 2);
                    switch (累计流量单位12)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox17.Text = 累计流量12A.Insert(6, ".") + 流量单位;

                    string 供水温度12 = mbus12.Substring(78, 4);
                    string 供水温度12A = 供水温度12.Substring(2, 2) + 供水温度12.Substring(0, 2);
                    textBox16.Text = 供水温度12A.Insert(2, ".") + "℃";
                    string 回水温度12 = mbus12.Substring(84, 4);
                    string 回水温度12A = 回水温度12.Substring(2, 2) + 回水温度12.Substring(0, 2);
                    textBox15.Text = 回水温度12A.Insert(2, ".") + "℃";
                    string 累计时间12 = mbus12.Substring(90, 6);
                    string 累计时间12A = 累计时间12.Substring(4, 2) + 累计时间12.Substring(2, 2) + 累计时间12.Substring(0, 2);
                    textBox14.Text = 累计时间12A + "h";
                    string 实时12 = mbus12.Substring(96, 14);
                    string 实时时间12 = 实时12.Substring(12, 2) + 实时12.Substring(10, 2) + 实时12.Substring(8, 2) + 实时12.Substring(6, 2) + 实时12.Substring(4, 2) + 实时12.Substring(2, 2) + 实时12.Substring(0, 2);
                    textBox13.Text = 实时时间12;
                    //第三组数据
                    JObject da22 = JObject.Parse(dat02[2].ToString());//dat[0]第一组数
                    textBox36.Text = da22["SER"].ToString();//完成
                    textBox35.Text = da22["time"].ToString();//完成
                    string mbus22 = da22["MBusResp"].ToString();//完成
                    string 地址22= mbus22.Substring(4, 14);
                    string 地址22A = 地址22.Substring(12, 2) + 地址22.Substring(10, 2) + 地址22.Substring(8, 2) + 地址22.Substring(6, 2) + 地址22.Substring(4, 2) + 地址22.Substring(2, 2) + 地址22.Substring(0, 2);
                    textBox34.Text = 地址22A;
                    string 日热量22 = mbus22.Substring(30, 8);
                    string 日热量22A = 日热量22.Substring(6, 2) + 日热量22.Substring(4, 2) + 日热量22.Substring(2, 2) + 日热量22.Substring(0, 2);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位         
                    string 日热量单位22 = mbus22.Substring(38, 2);
                    switch (日热量单位22)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox33.Text = 日热量22A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量22 = mbus22.Substring(40, 8);
                    string 累计热量22A = 累计热量22.Substring(6, 2) + 累计热量22.Substring(4, 2) + 累计热量22.Substring(2, 2) + 累计热量22.Substring(0, 2);
                    string 累计热量单位22 = mbus22.Substring(38, 2);
                    switch (累计热量单位22)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox32.Text = 累计热量22A.Insert(6, ".") + 热量单位;
                    string 瞬时热量22 = mbus22.Substring(50, 8);
                    string 瞬时热量22A = 瞬时热量22.Substring(6, 2) + 瞬时热量22.Substring(4, 2) + 瞬时热量22.Substring(2, 2) + 瞬时热量22.Substring(0, 2);
                    string 瞬时热量单位22 = mbus22.Substring(48, 2);
                    switch (瞬时热量单位22)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox31.Text = 瞬时热量22A.Insert(6, ".") + 热量单位;
                    string 瞬时流量22 = mbus22.Substring(60, 8);
                    string 瞬时流量22A = 瞬时流量22.Substring(6, 2) + 瞬时流量22.Substring(4, 2) + 瞬时流量22.Substring(2, 2) + 瞬时流量22.Substring(0, 2);
                    string 瞬时流量单位22 = mbus22.Substring(58, 2);
                    switch (瞬时流量单位22)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox30.Text = 瞬时流量22A.Insert(4, ".") + 流量单位;
                    string 累计流量22 = mbus22.Substring(70, 8);
                    string 累计流量22A = 累计流量22.Substring(6, 2) + 累计流量22.Substring(4, 2) + 累计流量22.Substring(2, 2) + 累计流量22.Substring(0, 2);
                    string 累计流量单位22 = mbus22.Substring(68, 2);
                    switch (累计流量单位22)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox29.Text = 累计流量22A.Insert(6, ".") + 流量单位;

                    string 供水温度22 = mbus22.Substring(78, 4);
                    string 供水温度22A = 供水温度22.Substring(2, 2) + 供水温度22.Substring(0, 2);
                    textBox28.Text = 供水温度22A.Insert(2, ".") + "℃";
                    string 回水温度22 = mbus22.Substring(84, 4);
                    string 回水温度22A = 回水温度22.Substring(2, 2) + 回水温度22.Substring(0, 2);
                    textBox27.Text = 回水温度22A.Insert(2, ".") + "℃";
                    string 累计时间22 = mbus22.Substring(90, 6);
                    string 累计时间22A = 累计时间22.Substring(4, 2) + 累计时间22.Substring(2, 2) + 累计时间22.Substring(0, 2);
                    textBox26.Text = 累计时间22A + "h";
                    string 实时22 = mbus22.Substring(96, 14);
                    string 实时时间22 = 实时22.Substring(12, 2) + 实时22.Substring(10, 2) + 实时22.Substring(8, 2) + 实时22.Substring(6, 2) + 实时22.Substring(4, 2) + 实时22.Substring(2, 2) + 实时22.Substring(0, 2);
                    textBox25.Text = 实时时间22;
                    break;
                #endregion
                #region 两个数组
                case 2:
                    JArray dat03 = JArray.Parse(jsonObj["data"].ToString());
                    JObject da03 = JObject.Parse(dat03[0].ToString());//dat[0]第一组数
                    textBox1.Text = da03["SER"].ToString();//完成
                    textBox2.Text = da03["time"].ToString();//完成
                    //textBox5.Text = da["MBusResp"].ToString();//完成
                    string mbus03 = da03["MBusResp"].ToString();//完成
                    //textBox5.Text = mbus;
                    string 地址03 = mbus03.Substring(4, 14);
                    string 地址03A = 地址03.Substring(12, 2) + 地址03.Substring(10, 2) + 地址03.Substring(8, 2) + 地址03.Substring(6, 2) + 地址03.Substring(4, 2) + 地址03.Substring(2, 2) + 地址03.Substring(0, 2);
                    textBox3.Text = 地址03A;
                    string 日热量03 = mbus03.Substring(30, 8);
                    string 日热量03A = 日热量03.Substring(6, 2) + 日热量03.Substring(4, 2) + 日热量03.Substring(2, 2) + 日热量03.Substring(0, 2);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位         
                    string 日热量单位03 = mbus03.Substring(38, 2);
                    switch (日热量单位03)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox4.Text = 日热量03A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量03 = mbus03.Substring(40, 8);
                    string 累计热量03A = 累计热量03.Substring(6, 2) + 累计热量03.Substring(4, 2) + 累计热量03.Substring(2, 2) + 累计热量03.Substring(0, 2);
                    string 累计热量单位03 = mbus03.Substring(38, 2);
                    switch (累计热量单位03)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox5.Text = 累计热量03A.Insert(6, ".") + 热量单位;
                    string 瞬时热量03 = mbus03.Substring(50, 8);
                    string 瞬时热量03A = 瞬时热量03.Substring(6, 2) + 瞬时热量03.Substring(4, 2) + 瞬时热量03.Substring(2, 2) + 瞬时热量03.Substring(0, 2);
                    string 瞬时热量单位03 = mbus03.Substring(48, 2);
                    switch (瞬时热量单位03)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox6.Text = 瞬时热量03A.Insert(6, ".") + 热量单位;
                    string 瞬时流量03 = mbus03.Substring(60, 8);
                    string 瞬时流量03A = 瞬时流量03.Substring(6, 2) + 瞬时流量03.Substring(4, 2) + 瞬时流量03.Substring(2, 2) + 瞬时流量03.Substring(0, 2);
                    string 瞬时流量单位03 = mbus03.Substring(58, 2);
                    switch (瞬时流量单位03)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox7.Text = 瞬时流量03A.Insert(4, ".") + 流量单位;
                    string 累计流量03 = mbus03.Substring(70, 8);
                    string 累计流量03A = 累计流量03.Substring(6, 2) + 累计流量03.Substring(4, 2) + 累计流量03.Substring(2, 2) + 累计流量03.Substring(0, 2);
                    string 累计流量单位03 = mbus03.Substring(68, 2);
                    switch (累计流量单位03)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox8.Text = 累计流量03A.Insert(6, ".") + 流量单位;

                    string 供水温度03 = mbus03.Substring(78, 4);
                    string 供水温度03A = 供水温度03.Substring(2, 2) + 供水温度03.Substring(0, 2);
                    textBox9.Text = 供水温度03A.Insert(2, ".") + "℃";
                    string 回水温度03 = mbus03.Substring(84, 4);
                    string 回水温度03A = 回水温度03.Substring(2, 2) + 回水温度03.Substring(0, 2);
                    textBox10.Text = 回水温度03A.Insert(2, ".") + "℃";
                    string 累计时间03 = mbus03.Substring(90, 6);
                    string 累计时间03A = 累计时间03.Substring(4, 2) + 累计时间03.Substring(2, 2) + 累计时间03.Substring(0, 2);
                    textBox11.Text = 累计时间03A + "h";
                    string 实时03 = mbus03.Substring(96, 14);

                    string 实时时间03 = 实时03.Substring(12, 2) + 实时03.Substring(10, 2) + 实时03.Substring(8, 2) + 实时03.Substring(6, 2) + 实时03.Substring(4, 2) + 实时03.Substring(2, 2) + 实时03.Substring(0, 2);
                    textBox12.Text = 实时时间03;
                    //第二组数据
                    JObject da13 = JObject.Parse(dat03[1].ToString());//dat[0]第一组数
                    textBox24.Text = da13["SER"].ToString();//完成
                    textBox23.Text = da13["time"].ToString();//完成
                    string mbus13 = da13["MBusResp"].ToString();//完成
                    string 地址13 = mbus13.Substring(4, 14);
                    string 地址13A = 地址13.Substring(12, 2) + 地址13.Substring(10, 2) + 地址13.Substring(8, 2) + 地址13.Substring(6, 2) + 地址13.Substring(4, 2) + 地址13.Substring(2, 2) + 地址13.Substring(0, 2);
                    textBox22.Text = 地址13A;
                    string 日热量13 = mbus13.Substring(30, 8);
                    string 日热量13A = 日热量13.Substring(6, 2) + 日热量13.Substring(4, 2) + 日热量13.Substring(2, 2) + 日热量13.Substring(0, 2);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位         
                    string 日热量单位13 = mbus13.Substring(38, 2);
                    switch (日热量单位13)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox21.Text = 日热量13A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量13 = mbus13.Substring(40, 8);
                    string 累计热量13A = 累计热量13.Substring(6, 2) + 累计热量13.Substring(4, 2) + 累计热量13.Substring(2, 2) + 累计热量13.Substring(0, 2);
                    string 累计热量单位13 = mbus13.Substring(38, 2);
                    switch (累计热量单位13)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox20.Text = 累计热量13A.Insert(6, ".") + 热量单位;
                    string 瞬时热量13 = mbus13.Substring(50, 8);
                    string 瞬时热量13A = 瞬时热量13.Substring(6, 2) + 瞬时热量13.Substring(4, 2) + 瞬时热量13.Substring(2, 2) + 瞬时热量13.Substring(0, 2);
                    string 瞬时热量单位13 = mbus13.Substring(48, 2);
                    switch (瞬时热量单位13)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox19.Text = 瞬时热量13A.Insert(6, ".") + 热量单位;
                    string 瞬时流量13 = mbus13.Substring(60, 8);
                    string 瞬时流量13A = 瞬时流量13.Substring(6, 2) + 瞬时流量13.Substring(4, 2) + 瞬时流量13.Substring(2, 2) + 瞬时流量13.Substring(0, 2);
                    string 瞬时流量单位13 = mbus13.Substring(58, 2);
                    switch (瞬时流量单位13)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox18.Text = 瞬时流量13A.Insert(4, ".") + 流量单位;
                    string 累计流量13 = mbus13.Substring(70, 8);
                    string 累计流量13A = 累计流量13.Substring(6, 2) + 累计流量13.Substring(4, 2) + 累计流量13.Substring(2, 2) + 累计流量13.Substring(0, 2);
                    string 累计流量单位13 = mbus13.Substring(68, 2);
                    switch (累计流量单位13)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox17.Text = 累计流量13A.Insert(6, ".") + 流量单位;

                    string 供水温度13 = mbus13.Substring(78, 4);
                    string 供水温度13A = 供水温度13.Substring(2, 2) + 供水温度13.Substring(0, 2);
                    textBox16.Text = 供水温度13A.Insert(2, ".") + "℃";
                    string 回水温度13 = mbus13.Substring(84, 4);
                    string 回水温度13A = 回水温度13.Substring(2, 2) + 回水温度13.Substring(0, 2);
                    textBox15.Text = 回水温度13A.Insert(2, ".") + "℃";
                    string 累计时间13 = mbus13.Substring(90, 6);
                    string 累计时间13A = 累计时间13.Substring(4, 2) + 累计时间13.Substring(2, 2) + 累计时间13.Substring(0, 2);
                    textBox14.Text = 累计时间13A + "h";
                    string 实时13 = mbus13.Substring(96, 14);
                    string 实时时间13 = 实时13.Substring(12, 2) + 实时13.Substring(10, 2) + 实时13.Substring(8, 2) + 实时13.Substring(6, 2) + 实时13.Substring(4, 2) + 实时13.Substring(2, 2) + 实时13.Substring(0, 2);
                    textBox13.Text = 实时时间13;
                    break;
#endregion
                #region 一个数组
                case 1:
                    JArray dat04 = JArray.Parse(jsonObj["data"].ToString());
                    JObject da04 = JObject.Parse(dat04[0].ToString());//dat[0]第一组数
                    textBox1.Text = da04["SER"].ToString();//完成
                    textBox2.Text = da04["time"].ToString();//完成
                    //textBox5.Text = da["MBusResp"].ToString();//完成
                    string mbus04 = da04["MBusResp"].ToString();//完成
                    //textBox5.Text = mbus;
                    string 地址04 = mbus04.Substring(4, 14);
                    string 地址04A = 地址04.Substring(12, 2) + 地址04.Substring(10, 2) + 地址04.Substring(8, 2) + 地址04.Substring(6, 2) + 地址04.Substring(4, 2) + 地址04.Substring(2, 2) + 地址04.Substring(0, 2);
                    textBox3.Text = 地址04A;
                    string 日热量04 = mbus04.Substring(30, 8);
                    string 日热量04A = 日热量04.Substring(6, 2) + 日热量04.Substring(4, 2) + 日热量04.Substring(2, 2) + 日热量04.Substring(0, 2);
                    //textBox2.Text = 日热量.Insert(6,"."); //无单位         
                    string 日热量单位04 = mbus04.Substring(38, 2);
                    switch (日热量单位04)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox4.Text = 日热量04A.Insert(6, ".") + 热量单位;//完成

                    string 累计热量04 = mbus04.Substring(40, 8);
                    string 累计热量04A = 累计热量04.Substring(6, 2) + 累计热量04.Substring(4, 2) + 累计热量04.Substring(2, 2) + 累计热量04.Substring(0, 2);
                    string 累计热量单位04 = mbus04.Substring(38, 2);
                    switch (累计热量单位04)
                    {
                        case "02":
                            热量单位 = "Wh";
                            break;
                        case "05":
                            热量单位 = "kwh";
                            break;
                        case "08":
                            热量单位 = "MWh";
                            break;
                        case "0A":
                            热量单位 = "MWh*100";
                            break;
                        case "01":
                            热量单位 = "J";
                            break;
                        case "0B":
                            热量单位 = "kJ";
                            break;
                        case "0E":
                            热量单位 = "MJ";
                            break;
                        case "11":
                            热量单位 = "GJ";
                            break;
                        case "13":
                            热量单位 = "GJ*100";
                            break;
                    }
                    textBox5.Text = 累计热量04A.Insert(6, ".") + 热量单位;
                    string 瞬时热量04 = mbus04.Substring(50, 8);
                    string 瞬时热量04A = 瞬时热量04.Substring(6, 2) + 瞬时热量04.Substring(4, 2) + 瞬时热量04.Substring(2, 2) + 瞬时热量04.Substring(0, 2);
                    string 瞬时热量单位04 = mbus04.Substring(48, 2);
                    switch (瞬时热量单位04)
                    {
                        case "12":
                            热量单位 = "GJ/h";
                            break;
                        case "14":
                            热量单位 = "W";
                            break;
                        case "17":
                            热量单位 = "kW";
                            break;
                        case "1A":
                            热量单位 = "MW";
                            break;
                    }
                    textBox6.Text = 瞬时热量04A.Insert(6, ".") + 热量单位;
                    string 瞬时流量04 = mbus04.Substring(60, 8);
                    string 瞬时流量04A = 瞬时流量04.Substring(6, 2) + 瞬时流量04.Substring(4, 2) + 瞬时流量04.Substring(2, 2) + 瞬时流量04.Substring(0, 2);
                    string 瞬时流量单位04 = mbus04.Substring(58, 2);
                    switch (瞬时流量单位04)
                    {
                        case "32":
                            流量单位 = "L/h";
                            break;
                        case "35":
                            流量单位 = "m³/h";
                            break;
                    }
                    textBox7.Text = 瞬时流量04A.Insert(4, ".") + 流量单位;
                    string 累计流量04 = mbus04.Substring(70, 8);
                    string 累计流量04A = 累计流量04.Substring(6, 2) + 累计流量04.Substring(4, 2) + 累计流量04.Substring(2, 2) + 累计流量04.Substring(0, 2);
                    string 累计流量单位04 = mbus04.Substring(68, 2);
                    switch (累计流量单位04)
                    {
                        case "29":
                            流量单位 = "L";
                            break;
                        case "2C":
                            流量单位 = "m³";
                            break;
                    }
                    textBox8.Text = 累计流量04A.Insert(6, ".") + 流量单位;

                    string 供水温度04 = mbus04.Substring(78, 4);
                    string 供水温度04A = 供水温度04.Substring(2, 2) + 供水温度04.Substring(0, 2);
                    textBox9.Text = 供水温度04A.Insert(2, ".") + "℃";
                    string 回水温度04 = mbus04.Substring(84, 4);
                    string 回水温度04A = 回水温度04.Substring(2, 2) + 回水温度04.Substring(0, 2);
                    textBox10.Text = 回水温度04A.Insert(2, ".") + "℃";
                    string 累计时间04 = mbus04.Substring(90, 6);
                    string 累计时间04A = 累计时间04.Substring(4, 2) + 累计时间04.Substring(2, 2) + 累计时间04.Substring(0, 2);
                    textBox11.Text = 累计时间04A + "h";
                    string 实时04 = mbus04.Substring(96, 14);

                    string 实时时间04 = 实时04.Substring(12, 2) + 实时04.Substring(10, 2) + 实时04.Substring(8, 2) + 实时04.Substring(6, 2) + 实时04.Substring(4, 2) + 实时04.Substring(2, 2) + 实时04.Substring(0, 2);
                    textBox12.Text = 实时时间04;
                    break;
                    #endregion
            }
        }
        public class Datapoints
        {
            public string at { get; set; }
            public string value { get; set; }
        }

        public class Datastreams
        {
            public List<Datapoints> datapoints { get; set; }
            public string id { get; set; }
        }

        public class Data
        {
            public string count { get; set; }
            public List<Datastreams> datastreams { get; set; }
        }

        public class RootObject
        {
            public string errno { get; set; }
            public Data data { get; set; }
            public string error { get; set; }
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void textBox7_TextChanged(object sender, EventArgs e)
        {

        }


    }
}
